'''
Created on 03/03/2009

@author: eh01
'''
from urllib2 import URLError
import base64
import unittest
import urllib2


class Test(unittest.TestCase):

    def testDeleteMessage(self):         
        username = '' # Put in username here
        password = '' # Put in password here
        base64string = base64.encodestring(
                '%s:%s' % (username, password))[:-1]
        authheader =  "Basic %s" % base64string
        request = urllib2.Request('http://localhost:8080/node/1/88')
#        request = urllib2.Request("http://eplanning-vic-au.appspot.com/node/1", data='<Tag1>BLAH1</Tag1>')
        request.add_header("Authorization", authheader)
        request.add_header('Content-Type', 'text/xml; charset=utf-8')
        request.get_method = lambda: 'DELETE'
        response = urllib2.urlopen(request)

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testDeleteMessage']
    unittest.main()